<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 400px;
            border: 1px solid blue;
            position: relative;
        }

        .in {
            width: 50px;
            height: 50px;
            background: orangered;
            position: absolute;
            top: 0;
            left: 0;
            /* animation-name: move;
            animation-duration: 10s; */
            /* 动画的运动形式 */
            /* animation-timing-function: linear; */
            /* 动画的延迟时间 */
            /* animation-delay: 3s; */

            /* 动画的合并写法 */
            animation: move 3s linear infinite;
            /* 动画的播放次数   infinite 无限次*/
            /* animation-iteration-count: infinite; */
            /* 动画是否逆向播放 */
            animation-direction: alternate;
            /* animation: 动画名称 持续时间 运动曲线 何时开始 播放次数 是否反方向 起始与结束状态 */
            /* animation: name duration timing-function delay iteration-count direction fill-mode */
        }

        @keyframes move {
            0% {
                top: 0;
                left: 0;
            }

            25% {
                top: 0;
                left: 350px;
            }

            50% {
                top: 350px;
                left: 350px;
            }

            75% {
                top: 350px;
                left: 0;
            }

            100% {
                top: 0;
                left: 0;
            }
        }

        .box:hover .in {

            animation-play-state: paused;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="in"></div>
    </div>
</body>

</html>